import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';

// ✅ 导入路由配置
import 'app/routes.dart';
import 'config/app_config.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await GetStorage.init();
  runApp(const SaunaApp());
}

class SaunaApp extends StatelessWidget {
  const SaunaApp({super.key});

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: 'Sauna Controller',
      debugShowCheckedModeBanner: false,

      // ✅ 用 initialRoute 代替 home
      initialRoute: Routes.splash,

      // ✅ 关键：注册所有页面
      getPages: AppPages.pages,

      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
    );
  }
}
